<?php
function smarty_modifier_hours($time) {
    $time = (int) $time;
    $h = floor($time / 3600);
    $m = floor(($time - ($h * 3600)) / 60);
    $s = $time - ($h * 3600) - ($m * 60);
    $h = strlen($h) == 1 ? "0$h" : $h;
    $m = strlen($m) == 1 ? "0$m" : $m;
    $s = strlen($s) == 1 ? "0$s" : $s;
    return "$h:$m:$s";
}
?>
